import numpy as np

"""
粒子系统
"""

class Particle:
    def __init__(self, position, velocity, lifetime, texture_id):
        self.position = position
        self.velocity = velocity
        self.lifetime = lifetime
        self.texture_id = texture_id
        self.age = 0
        self.size = 0.05
        self.rotation = 0.0
        self.rotation_speed = 0.0
        self.rotation_acceleration = 0.0
        self.rotation_deceleration = 0.0
        self.rotation_friction = 0.0


class ParticleSystem:
    def __init__(self, max_particles, texture_id):
        self.max_particles = max_particles
        self.particles = [Particle(
            position=np.array([0.0, 0.0, 0.0]),
            velocity=np.array([0.0, 0.0, 0.0]),
            lifetime=0.0,
            texture_id=texture_id
        ) for _ in range(max_particles)]
        self.particle_count = 0
